package com.laijiale.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * @author laijiale
 * @date 2025年01月08日 21:45
 */


@Schema(name = "菜单修改DTO")
@Data
public class MenuUpdateDTO implements Serializable {

    @NotNull(message = "主键不能为空")
    @Schema(description = "主键")
    private Long id;

    @Size(min = 1, max = 42, message = "标题长度必须在1~42之间")
    @Schema(description = "标题")
    private String title;

    @Size(min = 1, max = 170, message = "描述长度必须在1~170之间")
    @Schema(description = "描述")
    private String info;

    @Size(min = 1, max = 256, message = "跳转地址长度必须在1~256之间")
    @Schema(description = "跳转地址")
    private String url;

    @Size(min = 1, max = 256, message = "图标长度必须在1~256之间")
    @Schema(description = "图标")
    private String icon;

    @Range(min = 0, message = "父菜单主键最小为0")
    @Schema(description = "父菜单主键，0视为根节点")
    private Long pid;

    @Range(min = 0, message = "序号最小为0")
    @Schema(description = "序号")
    private Long idx;
}